<!--{if $perms}-->
<div class="right-card-header">
    <div class="title">管理员权限</div>
</div>
<ul class="proper-show proper-poewr">
    <!--{loop $perms $k $val}-->
    <li style="display:block;"><span class="{$val[2]}" title="$val[0]"></span></li>
    <!--{/loop}-->
</ul>
<div class="right-card-header">
    <div class="title">您的用户组权限</div>
</div>
<!--{if $_G['group']['perm']}-->
<ul class="proper-show proper-poewr">
    <!--{loop $perms $k $val}-->
    <li <!--{if $_G['group']['perm'] & $val[1]}-->style="display:block;"<!--{else}-->style="display:none;"<!--{/if}-->><span class="{$val[2]}" title="$val[0]"></span></li>
    <!--{/loop}-->
</ul>
<!--{else}-->
<div class="text-center">
    <img src="static/image/common/no_list.png">
    <p class="text-muted fs-5">{lang no_related_data}</p>
</div>
<!--{/if}-->
<!--{if $fileinfo['gid']}-->
<div class="right-card-header">
    <div class="title">一般协作成员权限</div>
    <!--{if $usergroupperm}--><button type="button" class="dcolor conpile-poewr" onclick="editgroupperm('{$fileinfo[rid]}','{$fileinfo[fid]}')" data-toggle="tooltip" data-placement="right" title="编辑<!--{if $fileinfo['isfolder']}-->目录<!--{else}-->文档<!--{/if}-->权限"><span class="mdi mdi-pencil fs-6"></span></button><!--{/if}-->
</div>
<!--{if $fperm}-->
<ul class="proper-show proper-poewr">
    <!--{loop $perms $k $val}-->
    <li <!--{if $fperm & $val[1]}-->style="display:block;"<!--{else}-->style="display:none;"<!--{/if}-->><span class="{$val[2]}" title="$val[0]"></span></li>
    <!--{/loop}-->
</ul>
<!--{else}-->
<div class="text-center">
    <img src="static/image/common/no_list.png">
    <p class="text-muted fs-5">未设置权限，继承目录权限</p>
</div>
<!--{/if}-->
<!--{/if}-->
<div class="right-card-header">
    <div class="title">您的实际生效权限<i class="ms-1 mdi mdi-information-outline" data-toggle="tooltip" data-placement="right" title="<!--{if $_G['adminid'] == 1}-->您作为系统管理员，拥有该目录的全部权限，不受任何限制。<!--{elseif isset($usergroupperm) && $usergroupperm > 0}-->您作为管理员，拥有该目录的全部管理权限。<!--{else}-->您的实际权限 = 一般协作成员权限 × 您的用户/组权限（仅两者都允许的操作才能生效）。<!--{/if}-->"></i></div>
</div>
<!--{if $myperm}-->
<ul class="proper-show proper-poewr">
    <!--{loop $perms $k $val}-->
    <li <!--{if $myperm & $val[1]}-->style="display:block;"<!--{else}-->style="display:none;"<!--{/if}-->><span class="{$val[2]}" title="$val[0]"></span></li>
    <!--{/loop}-->
</ul>
<!--{else}-->
<div class="text-center">
    <img src="static/image/common/no_list.png">
    <p class="text-muted fs-5">{lang no_permission}</p>
</div>
<!--{/if}-->
<!--{else}-->
<div class="text-center">
    <img src="static/image/common/no_list.png">
    <p class="text-muted fs-5">{lang no_related_data}</p>
</div>
<!--{/if}-->
<!--{if $_G['setting']['allowshare']}--><span class="form-text">系统管理员已关闭分享功能</span><!--{/if}-->
<!--{if $org}-->
<div class="right-card-header">
    <div class="title"><!--{if $org[type]== '1'}-->{lang group}<!--{else}--><!--{if $org[forgid]>0}-->{lang department}<!--{else}-->{lang organization}<!--{/if}--><!--{/if}-->{lang member}</div>
    <!--{if $usergroupperm && $org['type']}-->
    <button type="button" class="groupbutton dcolor" onclick="select_group_user();return false;"><span class="mdi mdi-plus-circle"></span></button>
    <!--{/if}-->
</div>
<!--{if $members}-->
<ul class="list-group mb-3 right-numerbottom memberlist" data-gid="{$fileinfo['gid']}">
    <!--{loop $members $v}-->
    <li class="list-group-item d-flex justify-content-between align-items-start {$v['uid']}_delete">
        <div class="fw-bold text-truncate">
            <div class="perm-avatar">
                {eval echo avatar_block($v['uid']);} <!--{if $v['uid'] == $_G['uid']}-->{lang my_self}<!--{else}-->$v['username']<!--{/if}-->
            </div>
            <span class="perm-name"><!--{if $v['perm'] == 0}-->{lang explorer_groupperm_cooperative}<!--{elseif $v['perm'] == 1}-->{lang explorer_groupperm_manager}<!--{elseif $v['perm'] == 2}-->{lang explorer_groupperm_creater}<!--{/if}--></span>
        </div>
        <!--{if $usergroupperm}-->
        <a href="javascript:;" class="js-popbox member_details_info dropdown-toggle fs-5" data-placement="bottom" data-trigger="focus" data-auto-adapt="true" data-toggle="popover" style="display: inline-block;width: 28px;" data-href="{MOD_URL}&op=group&do=right_popbox&gid=$fileinfo['gid']&uid={$v['uid']}&ajaxdata=html"></a>
        <!--{/if}-->
    </li>
    <!--{/loop}-->
</ul>
$multi
<!--{else}-->
<div class="text-center">
    <img src="{MOD_PATH}/images/noFilePage-groupForbidden.png">
    <p class="text-muted fs-5">{lang no_members}</p>
</div>
<!--{/if}-->
<!--{/if}-->
<script type="text/javascript" reload="1">
    var userids = '';
$(document).ready(function(){
    userids = '{$userstr}';
    $('[data-toggle="tooltip"]').tooltip();
});
jQuery(".right-numerbottom .js-popbox").each(function(){
    jQuery(this).popbox();
});
function select_group_user(){
	var userhref = 'index.php?mod=system&op=selorguser&template=1&callback=seluser_group&stype=2&range=1&onlymyorg=<!--{if $_G['setting']['explorer_mermoryonlymyorg'] == '1'}-->0<!--{else}-->1<!--{/if}-->&multiple=1&ids='+userids;
    hideWindow('property');
    showWindow('adduser',userhref,'get','0')
}
function seluser_group(ids,data) {
    var formdata={};
    formdata.type=1;
    formdata.formhash='{FORMHASH}';
    formdata.selectsubmit=true;
    formdata.uids=ids.join(',');
    var gid = '{$fileinfo['gid']}';
    var url = MOD_URL + '&op=group&do=group_ajax&operation=addgroupuser&gid='+gid;
    $.post(url, formdata, function (data) {
        if (data['success']) {
            showmessage('{lang do_success}','success',3000,1);
            if ($('.perm-tab').hasClass('active')) {
                jQuery('.perm-tab').click();
            }
        } else if (data['error']) {
			layer.alert(data['error'], {skin:'lyear-skin-danger'});
        }
    }, 'json').fail(function (jqXHR, textStatus, errorThrown) {
            showmessage('{lang do_failed}', 'error', 3000, 1);
        });
    return false;
};
</script>